<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s"  uri="/struts-tags"%>

<title>借款合同</title><span id="navlink">合同明细查询 >> 借款合同</span>

<table class="table_box table_all_border" cellspacing="0" cellpadding="0">
	<tr>
		<td style="width:100px" align="right">合同编号</td>
		<td>${contract.contractId}</td>
		<td style="width:100px" align="right">合同名称</td>
		<td>${contract.contractname }</td>
	</tr>
	<tr>
		<td align="right">借款人</td>
		<td>${clientname}</td>
		<td align="right">证件号</td>
		<td>${customcode}(${codetype })</td>
		
	</tr><tr>
		<td align="right">地址</td>
		<td>${address}</td>
		<td align="right">联系电话</td>
		<td>${phone }</td>
	</tr>
	<tr>
	<td align="right">借款金额</td>
		<td><s:text name="f.money"><s:param value="contract.applymoney"/></s:text></td>
		<td align="right">执行利率</td>
		<td><s:text name="f.number.five"><s:param value="contract.performrates"/></s:text>%</td>
	</tr>
	<tr>
		<td align="right">合同开始日期</td>
		<td><s:text name="f.date.ymd"><s:param value="contract.startdate"/></s:text></td>
		<td align="right">合同结束日期</td>
		<td><s:text name="f.date.ymd"><s:param value="contract.enddate"/></s:text></td>
	</tr>
	<tr>
		<td align="right">贷款发放次数</td>
		<td>${contract.loangrant }次</td>
		<td align="right">还款方式</td>
		<td>${modeofrepayment}</td>	
	</tr>
	<tr>
	    <td align="right">已发放贷款</td>
	    <td><s:text name="f.money"><s:param value="count"/></s:text></td>
	    <td align="right">未发放贷款</td>
	    <td><s:text name="f.money"><s:param value="ungrant"/></s:text></td>
	<tr>
		<td align="right">合同签定日期</td>
		<td><s:text name="f.date.ymd"><s:param value="contract.contractdate"/></s:text></td>
		<td align="right">业务员</td>
		<td></td>
		
	</tr>
	<tr>
	    <td align="right">预警日期</td>
		<td colspan="3"></td>
	</tr>
	<tr>
		<td align="right">备注</td>
		<td colspan="3"></td>	
	</tr>
</table>
</br>
<table  class="table_box table_all_border" cellspacing="0" cellpadding="0">
	<caption align="left" style="font-weight:bold;font-size:15px;">贷款发放明细</caption>
	<tr>
		<th>序号</th>
		<th>发放时间</th>
		<th>发放金额</th>
		<th>状态</th>
	</tr>
	<s:iterator value="loangrantList" status="index" var="var">
	<tr>
		<td style="text-align:center"><s:property value="#index.count"/></td>
		<td style="text-align:center"><s:text name="f.date.ymd"><s:param value="grantdate"/></s:text></td>
		<td style="text-align:center"><s:text name="f.money"><s:param value="grantmoney"/></s:text></td>
		<td style="text-align:center"><s:if test='state==0'>已回收</s:if>
									 <s:elseif test='state==9'>已作废</s:elseif>
									 <s:elseif test='state==2'>已发放</s:elseif>
									 <s:else>未发放</s:else></td>
	</tr>
	</s:iterator>
</table>
</br>
<table  class="table_box table_all_border" cellspacing="0" cellpadding="0">
	<caption align="left" style="font-weight:bold;font-size:15px;">相关从合同</caption>
	<s:if test='E=="1"'>
	<tr>
	<th colspan="6">保证合同</th>
	</tr>
	<tr>
	<th>合同编号</th>
	<th>合同名称</th>
	<th>保证人编号</th>
	<th>保证金额</th>
	<th>保证期限</th>
	<th>操作</th>
	</tr>
	<s:iterator value="ensureList" status="index" var="var">
	<tr>
		<td style="text-align:center">${ensureid}</td>
		<td style="text-align:center">${ensurename}</td>
		<td style="text-align:center">${customensureid}</td>
		<td style="text-align:center"><s:text name="f.money"><s:param value="ensuremoney"/></s:text></td>
		<td style="text-align:center"><s:text name="f.date.ymd"><s:param value="start"/></s:text>——<s:text name="f.date.ymd"><s:param value="end"/></s:text></td>
		<td style="text-align:center">
		<a href="showRelationDetail!ShowEnsureDetail?ensureid=${id }">详情</a>
		<a href="contractEnsurePrint?id=${id}">打印</a></td>
	</tr>
	</s:iterator>
	</s:if>
	<s:if test='M=="1"'>
	<tr>
	<th colspan="6">抵押合同</th>
	</tr>
	<tr>
	<th>合同编号</th>
	<th>合同名称</th>
	<th>抵押物编号</th>
	<th>抵押金额</th>
	<th>抵押期限</th>
	<th>操作</th>
	</tr>
	<s:iterator value="mortgageList" status="index" var="var">
	<tr>
		<td style="text-align:center">${mortgageid}</td>
		<td style="text-align:center">${mortgagename}</td>
		<td style="text-align:center">${thingsid}</td>
		<td style="text-align:center"><s:text name="f.money"><s:param value="mortgagemoney"/></s:text></td>
		<td style="text-align:center"><s:text name="f.date.ymd"><s:param value="start"/></s:text>——<s:text name="f.date.ymd"><s:param value="end"/></s:text></td>
		<td style="text-align:center">
		<a href="showRelationDetail!ShowMortgageDetail?mortgageid=${id }">详情</a>
		<a href="contractMortgagePrint?id=${id}">打印</a></td>
	</tr>
	</s:iterator>
	</s:if>
	<s:if test='P=="1"'>
	<tr>
	<th colspan="6">质押合同</th>
	</tr>
	<tr>
	<th>合同编号</th>
	<th>合同名称</th>
	<th>质押物编号</th>
	<th>质押金额</th>
	<th>质押期限</th>
	<th>操作</th>
	</tr>
	<s:iterator value="pledgeList" status="index" var="var">
	<tr>
		<td style="text-align:center">${pledgeid}</td>
		<td style="text-align:center">${pledgename}</td>
		<td style="text-align:center">${thingsid}</td>
		<td style="text-align:center"><s:text name="f.money"><s:param value="pledgemoney"/></s:text></td>
		<td style="text-align:center"><s:text name="f.date.ymd"><s:param value="start"/></s:text>——<s:text name="f.date.ymd"><s:param value="end"/></s:text></td>
		<td style="text-align:center">
		<a href="showRelationDetail!ShowPledgeDetail?pledgeid=${id }">详情</a>
		<a href="contractPledgePrint?id=${id}">打印</a></td>
	</tr>
	</s:iterator>
	</s:if>
	<s:if test='E=="0"&&M=="0"&&P=="0"'>
	<tr><td colspan="6" style="font-weight:bold;font-size:15px;" align="center">不存在相关从合同</td></tr>
	</s:if>
</table>
</br>
<table class="table_box table_all" cellspacing="0" cellpadding="0">
<center><input type="button" onclick="javascript:history.go(-1)" value="返回" /></center>
</table>

